home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 8 / Eagles_Nest_Mac_Collection_Disc_8.TOAST / Developer Environments / AAISProlog / Examples / Apple Events / apple events1.p < prev    next >
MacBinary  |  1992-04-07  |  8.0 KB  |  [TEXT/AIFC]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert ZX81 Sinclair BASIC (image/sinclairBASIC) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert bsdiff patch (other/bsdiffPatch) ext Unsupported
1% dexvert imgdiff patch (other/imgdiffPatch) ext Unsupported
1% dexvert WSUS Patch Storage File (other/wsusPatchStorageFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue Apr 7 00:32:51 1992, modified Tue Apr 7 00:32:51 1992, creator 'AIFC', type ASCII, 7635 bytes "apple events1.p" , at 0x1e53 380 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[AIFC]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0f 61 70 70 6c 65 20 | 65 76 65 6e 74 73 31 2e |..apple |events1.|
|00000010| 70 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |p.......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 41 49 46 | 43 01 00 00 00 00 00 00 |.TEXTAIF|C.......|
|00000050| 00 00 00 00 00 1d d3 00 | 00 01 7c a6 06 d6 73 a6 |........|..|...s.|
|00000060| 06 d6 73 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..s.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 b4 1d 00 00 |........|........|
|00000080| 2f 2a 0d 20 2a 20 41 70 | 70 6c 65 20 45 76 65 6e |/*. * Ap|ple Even|
|00000090| 74 73 31 2e 70 20 3a 20 | 53 6f 6d 65 20 55 73 65 |ts1.p : |Some Use|
|000000a0| 66 75 6c 20 41 70 70 6c | 65 20 45 76 65 6e 74 20 |ful Appl|e Event |
|000000b0| 46 75 6e 63 74 69 6f 6e | 73 2e 0d 20 2a 0d 20 2a |Function|s.. *. *|
|000000c0| 20 43 6f 70 79 72 69 67 | 68 74 2c 20 a9 20 31 39 | Copyrig|ht, . 19|
|000000d0| 39 32 20 41 64 76 61 6e | 63 65 64 20 41 2e 20 49 |92 Advan|ced A. I|
|000000e0| 2e 20 53 79 73 74 65 6d | 73 2c 20 49 6e 63 2e 0d |. System|s, Inc..|
|000000f0| 20 2a 20 41 6c 6c 20 72 | 69 67 68 74 73 20 72 65 | * All r|ights re|
|00000100| 73 65 72 76 65 64 2e 0d | 20 2a 20 54 68 69 73 20 |served..| * This |
|00000110| 66 69 6c 65 20 6d 61 79 | 20 6e 6f 74 20 62 65 20 |file may| not be |
|00000120| 63 6f 70 69 65 64 20 6f | 72 20 64 69 73 74 72 69 |copied o|r distri|
|00000130| 62 75 74 65 64 20 77 69 | 74 68 6f 75 74 20 74 68 |buted wi|thout th|
|00000140| 65 20 0d 20 2a 20 77 72 | 69 74 74 65 6e 20 70 65 |e . * wr|itten pe|
|00000150| 72 6d 69 73 73 69 6f 6e | 20 6f 66 20 41 64 76 61 |rmission| of Adva|
|00000160| 6e 63 65 64 20 41 2e 20 | 49 2e 20 53 79 73 74 65 |nced A. |I. Syste|
|00000170| 6d 73 2c 20 49 6e 63 2e | 0d 20 2a 0d 20 2a 20 46 |ms, Inc.|. *. * F|
|00000180| 75 6e 63 74 69 6f 6e 73 | 20 64 65 66 69 6e 65 64 |unctions| defined|
|00000190| 20 69 6e 20 74 68 69 73 | 20 66 69 6c 65 3a 0d 20 | in this| file:. |
|000001a0| 2a 0d 20 2a 20 61 65 47 | 65 74 50 61 72 61 6d 28 |*. * aeG|etParam(|
|000001b0| 4b 65 79 57 6f 72 64 2c | 20 56 61 6c 75 65 29 0d |KeyWord,| Value).|
|000001c0| 20 2a 20 61 65 47 65 74 | 41 74 74 72 69 62 75 74 | * aeGet|Attribut|
|000001d0| 65 28 4b 65 79 57 6f 72 | 64 2c 20 56 61 6c 75 65 |e(KeyWor|d, Value|
|000001e0| 29 0d 20 2a 20 61 65 47 | 65 74 4c 6f 6e 67 41 74 |). * aeG|etLongAt|
|000001f0| 74 72 69 62 75 74 65 28 | 41 70 70 6c 65 45 76 65 |tribute(|AppleEve|
|00000200| 6e 74 2c 20 4b 65 79 57 | 6f 72 64 2c 20 56 61 72 |nt, KeyW|ord, Var|
|00000210| 5f 49 6e 74 65 67 65 72 | 29 0d 20 2a 20 61 65 43 |_Integer|). * aeC|
|00000220| 6c 61 73 73 49 64 28 56 | 61 72 5f 43 6c 61 73 73 |lassId(V|ar_Class|
|00000230| 5f 49 6e 74 65 67 65 72 | 2c 20 56 61 72 5f 49 64 |_Integer|, Var_Id|
|00000240| 5f 49 6e 74 65 67 65 72 | 29 0d 20 2a 20 61 65 41 |_Integer|). * aeA|
|00000250| 6c 6c 50 61 72 61 6d 73 | 28 56 61 72 5f 4c 69 73 |llParams|(Var_Lis|
|00000260| 74 29 0d 20 2a 20 61 65 | 4d 69 73 73 69 6e 67 50 |t). * ae|MissingP|
|00000270| 61 72 61 6d 73 28 56 61 | 72 5f 4c 69 73 74 29 0d |arams(Va|r_List).|
|00000280| 20 2a 20 61 65 4d 69 73 | 73 69 6e 67 50 61 72 61 | * aeMis|singPara|
|00000290| 6d 28 56 61 72 5f 4b 65 | 79 77 6f 72 64 5f 56 61 |m(Var_Ke|yword_Va|
|000002a0| 6c 75 65 29 0d 20 2a 20 | 74 68 69 73 5f 70 72 6f |lue). * |this_pro|
|000002b0| 63 65 73 73 28 50 72 6f | 63 65 73 73 49 6e 66 6f |cess(Pro|cessInfo|
|000002c0| 52 65 63 29 0d 20 2a 20 | 62 72 65 61 6b 5f 67 65 |Rec). * |break_ge|
|000002d0| 6e 65 72 69 63 5f 61 70 | 70 6c 65 5f 65 76 65 6e |neric_ap|ple_even|
|000002e0| 74 73 0d 20 2a 0d 20 2a | 20 41 6c 73 6f 20 6f 66 |ts. *. *| Also of|
|000002f0| 20 69 6e 74 65 72 65 73 | 74 3a 20 73 65 65 20 74 | interes|t: see t|
|00000300| 68 65 20 66 69 6c 65 20 | 3a 3a 3a 45 6e 76 69 72 |he file |:::Envir|
|00000310| 6f 6e 6d 65 6e 74 3a 70 | 72 6f 63 65 73 73 65 73 |onment:p|rocesses|
|00000320| 2e 70 2c 0d 20 2a 09 77 | 68 65 72 65 20 64 6f 63 |.p,. *.w|here doc|
|00000330| 75 6d 65 6e 74 65 64 20 | 61 6e 64 20 75 6e 64 6f |umented |and undo|
|00000340| 63 75 6d 65 6e 74 65 64 | 20 66 75 6e 63 74 69 6f |cumented| functio|
|00000350| 6e 73 20 61 72 65 20 64 | 65 66 69 6e 65 64 20 61 |ns are d|efined a|
|00000360| 6e 64 0d 20 2a 09 64 65 | 73 63 72 69 62 65 64 2e |nd. *.de|scribed.|
|00000370| 0d 20 2a 20 41 6d 6f 6e | 67 20 74 68 65 20 75 6e |. * Amon|g the un|
|00000380| 64 6f 63 75 6d 6e 74 65 | 64 20 66 75 6e 63 74 69 |documnte|d functi|
|00000390| 6f 6e 73 20 64 65 66 69 | 6e 65 64 20 69 6e 20 74 |ons defi|ned in t|
|000003a0| 68 61 74 20 66 69 6c 65 | 20 74 68 61 74 20 6d 61 |hat file| that ma|
|000003b0| 79 20 62 65 0d 20 2a 20 | 75 73 65 66 75 6c 3a 0d |y be. * |useful:.|
|000003c0| 20 2a 09 61 65 41 64 64 | 50 61 72 61 6d 28 41 70 | *.aeAdd|Param(Ap|
|000003d0| 70 6c 65 45 76 65 6e 74 | 2c 20 4b 65 79 57 6f 72 |pleEvent|, KeyWor|
|000003e0| 64 20 3d 20 56 61 6c 75 | 65 29 0d 20 2a 09 61 65 |d = Valu|e). *.ae|
|000003f0| 41 64 64 50 61 72 61 6d | 73 28 41 70 70 6c 65 45 |AddParam|s(AppleE|
|00000400| 76 65 6e 74 2c 20 4b 65 | 79 57 6f 72 64 56 61 6c |vent, Ke|yWordVal|
|00000410| 75 65 4c 69 73 74 29 0d | 20 2a 09 61 65 41 64 64 |ueList).| *.aeAdd|
|00000420| 41 74 74 72 69 62 75 74 | 65 28 41 70 70 6c 65 45 |Attribut|e(AppleE|
|00000430| 76 65 6e 74 2c 20 4b 65 | 79 57 6f 72 64 20 3d 20 |vent, Ke|yWord = |
|00000440| 56 61 6c 75 65 29 0d 20 | 2a 09 61 65 41 64 64 41 |Value). |*.aeAddA|
|00000450| 74 74 72 69 62 75 74 65 | 73 28 41 70 70 6c 65 45 |ttribute|s(AppleE|
|00000460| 76 65 6e 74 2c 20 4b 65 | 79 57 6f 72 64 56 61 6c |vent, Ke|yWordVal|
|00000470| 75 65 4c 69 73 74 29 0d | 20 2a 2f 0d 2f 2a 0d 20 |ueList).| */./*. |
|00000480| 2a 20 63 6f 6e 76 65 72 | 74 5f 61 65 64 65 73 63 |* conver|t_aedesc|
|00000490| 31 28 41 45 44 65 73 63 | 2c 20 56 61 6c 75 65 29 |1(AEDesc|, Value)|
|000004a0| 0d 20 2a 09 74 68 69 73 | 20 69 73 20 73 69 6d 69 |. *.this| is simi|
|000004b0| 6c 61 72 20 74 6f 20 63 | 6f 6e 76 65 72 74 5f 61 |lar to c|onvert_a|
|000004c0| 65 64 65 73 63 20 65 78 | 63 65 70 74 20 74 68 61 |edesc ex|cept tha|
|000004d0| 74 20 69 66 20 69 74 0d | 20 2a 09 63 61 6e 6e 6f |t if it.| *.canno|
|000004e0| 74 20 63 6f 6e 76 65 72 | 74 20 61 6e 20 61 65 64 |t conver|t an aed|
|000004f0| 65 73 63 20 74 6f 20 61 | 20 70 72 6f 6c 6f 67 20 |esc to a| prolog |
|00000500| 6f 62 6a 65 63 74 2c 20 | 74 68 65 20 73 65 63 6f |object, |the seco|
|00000510| 6e 64 20 61 72 67 75 6d | 65 6e 74 0d 20 2a 09 69 |nd argum|ent. *.i|
|00000520| 73 20 74 68 65 6e 20 75 | 6e 69 66 69 65 64 20 77 |s then u|nified w|
|00000530| 69 74 68 20 74 68 65 20 | 61 65 64 65 73 63 20 6f |ith the |aedesc o|
|00000540| 62 6a 65 63 74 20 77 68 | 69 63 68 20 69 73 20 72 |bject wh|ich is r|
|00000550| 65 74 75 72 6e 65 64 2e | 0d 20 2a 09 54 68 75 73 |eturned.|. *.Thus|
|00000560| 20 77 68 65 6e 20 75 73 | 65 64 20 74 6f 20 74 72 | when us|ed to tr|
|00000570| 79 20 74 6f 20 63 6f 6e | 76 65 72 74 20 61 6e 20 |y to con|vert an |
|00000580| 61 65 64 65 73 63 20 6f | 62 6a 65 63 74 20 74 6f |aedesc o|bject to|
|00000590| 20 61 20 70 72 6f 6c 6f | 67 0d 20 2a 09 6f 62 6a | a prolo|g. *.obj|
|000005a0| 65 63 74 2c 20 74 68 69 | 73 20 66 75 6e 63 74 69 |ect, thi|s functi|
|000005b0| 6f 6e 20 77 69 6c 6c 20 | 61 6c 77 61 79 73 20 73 |on will |always s|
|000005c0| 75 63 63 65 65 64 2e 20 | 57 68 65 6e 20 74 68 65 |ucceed. |When the|
|000005d0| 20 63 6f 6e 76 65 72 73 | 69 6f 6e 0d 20 2a 09 63 | convers|ion. *.c|
|000005e0| 61 6e 20 6e 6f 74 20 68 | 61 70 70 65 6e 65 64 2c |an not h|appened,|
|000005f0| 20 56 61 6c 75 65 20 77 | 69 6c 6c 20 62 65 20 75 | Value w|ill be u|
|00000600| 6e 69 66 69 65 64 20 77 | 69 74 68 20 74 68 65 20 |nified w|ith the |
|00000610| 61 65 64 65 73 63 20 6f | 62 6a 65 63 74 2e 0d 20 |aedesc o|bject.. |
|00000620| 2a 2f 0d 3a 2d 20 6c 6f | 63 61 6c 28 63 6f 6e 76 |*/.:- lo|cal(conv|
|00000630| 65 72 74 5f 61 65 64 65 | 73 63 31 2f 32 29 2e 0d |ert_aede|sc1/2)..|
|00000640| 0d 63 6f 6e 76 65 72 74 | 5f 61 65 64 65 73 63 31 |.convert|_aedesc1|
|00000650| 28 41 45 44 65 73 63 2c | 20 56 61 6c 75 65 29 20 |(AEDesc,| Value) |
|00000660| 3a 2d 0d 09 63 6f 6e 76 | 65 72 74 5f 61 65 64 65 |:-..conv|ert_aede|
|00000670| 73 63 28 41 45 44 65 73 | 63 2c 20 56 61 6c 75 65 |sc(AEDes|c, Value|
|00000680| 29 2c 0d 09 21 2e 0d 63 | 6f 6e 76 65 72 74 5f 61 |),..!..c|onvert_a|
|00000690| 65 64 65 73 63 31 28 41 | 45 44 65 73 63 2c 20 41 |edesc1(A|EDesc, A|
|000006a0| 45 44 65 73 63 29 2e 0d | 0d 2f 2a 0d 20 2a 20 61 |EDesc)..|./*. * a|
|000006b0| 65 47 65 74 41 74 74 72 | 69 62 75 74 65 28 4b 65 |eGetAttr|ibute(Ke|
|000006c0| 79 57 6f 72 64 2c 20 56 | 61 72 5f 56 61 6c 75 65 |yWord, V|ar_Value|
|000006d0| 29 20 3a 0d 20 2a 09 72 | 65 74 72 69 65 76 65 20 |) :. *.r|etrieve |
|000006e0| 74 68 65 20 61 74 74 72 | 69 62 75 74 65 20 76 61 |the attr|ibute va|
|000006f0| 6c 75 65 20 66 6f 72 20 | 74 68 65 20 73 70 65 63 |lue for |the spec|
|00000700| 69 66 69 65 64 20 6b 65 | 79 77 6f 72 64 20 66 72 |ified ke|yword fr|
|00000710| 6f 6d 0d 20 2a 09 74 68 | 65 20 63 75 72 72 65 6e |om. *.th|e curren|
|00000720| 74 20 61 70 70 6c 65 20 | 65 76 65 6e 74 2e 20 20 |t apple |event. |
|00000730| 56 61 6c 75 65 20 77 69 | 6c 6c 20 62 65 20 63 6f |Value wi|ll be co|
|00000740| 6e 76 65 72 74 65 64 20 | 74 6f 20 61 20 50 72 6f |nverted |to a Pro|
|00000750| 6c 6f 67 0d 20 2a 09 6f | 62 6a 65 63 74 20 69 73 |log. *.o|bject is|
|00000760| 20 70 6f 73 73 69 62 6c | 65 20 62 79 20 63 6f 6e | possibl|e by con|
|00000770| 76 65 72 74 5f 61 65 64 | 65 73 63 2e 20 20 4f 74 |vert_aed|esc. Ot|
|00000780| 68 65 72 77 69 73 65 20 | 69 74 20 77 69 6c 6c 20 |herwise |it will |
|00000790| 62 65 20 0d 20 2a 09 61 | 6e 20 61 65 64 65 73 63 |be . *.a|n aedesc|
|000007a0| 20 6f 62 6a 65 63 74 2e | 20 20 43 6c 65 61 6e 20 | object.| Clean |
|000007b0| 75 70 20 77 69 6c 6c 20 | 62 65 20 70 65 72 66 6f |up will |be perfo|
|000007c0| 72 6d 65 64 20 62 79 20 | 70 72 6f 6c 6f 67 20 66 |rmed by |prolog f|
|000007d0| 6f 72 0d 20 2a 09 61 6c | 6c 20 61 65 64 65 73 63 |or. *.al|l aedesc|
|000007e0| 20 6f 62 6a 65 63 74 73 | 20 63 72 65 61 74 65 64 | objects| created|
|000007f0| 20 61 75 74 6f 6d 61 74 | 69 63 61 6c 6c 79 2e 0d | automat|ically..|
|00000800| 20 2a 09 56 61 72 5f 56 | 61 6c 75 65 20 77 69 6c | *.Var_V|alue wil|
|00000810| 6c 20 62 65 20 62 6f 75 | 6e 64 20 74 6f 20 74 68 |l be bou|nd to th|
|00000820| 65 20 76 61 6c 75 65 20 | 69 66 20 61 76 61 69 6c |e value |if avail|
|00000830| 61 62 6c 65 2e 0d 20 2a | 09 54 68 69 73 20 77 69 |able.. *|.This wi|
|00000840| 6c 6c 20 66 61 69 6c 20 | 69 66 20 74 68 65 20 61 |ll fail |if the a|
|00000850| 74 74 72 69 62 75 74 65 | 20 64 6f 65 73 20 6e 6f |ttribute| does no|
|00000860| 74 20 65 78 69 73 74 2e | 0d 20 2a 2f 0d 61 65 47 |t exist.|. */.aeG|
|00000870| 65 74 41 74 74 72 69 62 | 75 74 65 28 4b 65 79 57 |etAttrib|ute(KeyW|
|00000880| 6f 72 64 2c 20 56 61 6c | 75 65 29 20 3a 2d 0d 09 |ord, Val|ue) :-..|
|00000890| 61 65 47 65 74 54 68 65 | 43 75 72 72 65 6e 74 45 |aeGetThe|CurrentE|
|000008a0| 76 65 6e 74 28 41 70 70 | 6c 65 45 76 65 6e 74 2c |vent(App|leEvent,|
|000008b0| 20 30 29 2c 0d 09 61 65 | 47 65 74 41 74 74 72 69 | 0),..ae|GetAttri|
|000008c0| 62 75 74 65 44 65 73 63 | 28 41 70 70 6c 65 45 76 |buteDesc|(AppleEv|
|000008d0| 65 6e 74 2c 20 4b 65 79 | 57 6f 72 64 2c 20 60 2a |ent, Key|Word, `*|
|000008e0| 2a 2a 2a 60 2c 20 44 65 | 73 63 2c 20 30 29 2c 0d |***`, De|sc, 0),.|
|000008f0| 09 63 6f 6e 76 65 72 74 | 5f 61 65 64 65 73 63 31 |.convert|_aedesc1|
|00000900| 28 44 65 73 63 2c 20 56 | 61 6c 75 65 29 2e 0d 09 |(Desc, V|alue)...|
|00000910| 0d 2f 2a 0d 20 2a 20 61 | 65 47 65 74 50 61 72 61 |./*. * a|eGetPara|
|00000920| 6d 28 4b 65 79 57 6f 72 | 64 2c 20 56 61 72 5f 56 |m(KeyWor|d, Var_V|
|00000930| 61 6c 75 65 29 20 3a 0d | 20 2a 09 72 65 74 72 69 |alue) :.| *.retri|
|00000940| 65 76 65 20 74 68 65 20 | 70 61 72 61 6d 65 74 65 |eve the |paramete|
|00000950| 72 20 76 61 6c 75 65 20 | 66 6f 72 20 74 68 65 20 |r value |for the |
|00000960| 73 70 65 63 69 66 69 65 | 64 20 6b 65 79 77 6f 72 |specifie|d keywor|
|00000970| 64 20 66 72 6f 6d 0d 20 | 2a 09 74 68 65 20 63 75 |d from. |*.the cu|
|00000980| 72 72 65 6e 74 20 61 70 | 70 6c 65 20 65 76 65 6e |rrent ap|ple even|
|00000990| 74 2e 20 20 56 61 6c 75 | 65 20 77 69 6c 6c 20 62 |t. Valu|e will b|
|000009a0| 65 20 63 6f 6e 76 65 72 | 74 65 64 20 74 6f 20 61 |e conver|ted to a|
|000009b0| 20 50 72 6f 6c 6f 67 0d | 20 2a 09 6f 62 6a 65 63 | Prolog.| *.objec|
|000009c0| 74 20 69 73 20 70 6f 73 | 73 69 62 6c 65 20 62 79 |t is pos|sible by|
|000009d0| 20 63 6f 6e 76 65 72 74 | 5f 61 65 64 65 73 63 2e | convert|_aedesc.|
|000009e0| 20 20 4f 74 68 65 72 77 | 69 73 65 20 69 74 20 77 | Otherw|ise it w|
|000009f0| 69 6c 6c 20 62 65 20 0d | 20 2a 09 61 6e 20 61 65 |ill be .| *.an ae|
|00000a00| 64 65 73 63 20 6f 62 6a | 65 63 74 2e 20 20 43 6c |desc obj|ect. Cl|
|00000a10| 65 61 6e 20 75 70 20 77 | 69 6c 6c 20 62 65 20 70 |ean up w|ill be p|
|00000a20| 65 72 66 6f 72 6d 65 64 | 20 62 79 20 70 72 6f 6c |erformed| by prol|
|00000a30| 6f 67 20 66 6f 72 0d 20 | 2a 09 61 6c 6c 20 61 65 |og for. |*.all ae|
|00000a40| 64 65 73 63 20 6f 62 6a | 65 63 74 73 20 63 72 65 |desc obj|ects cre|
|00000a50| 61 74 65 64 20 61 75 74 | 6f 6d 61 74 69 63 61 6c |ated aut|omatical|
|00000a60| 6c 79 2e 0d 20 2a 09 56 | 61 72 5f 56 61 6c 75 65 |ly.. *.V|ar_Value|
|00000a70| 20 77 69 6c 6c 20 62 65 | 20 62 6f 75 6e 64 20 74 | will be| bound t|
|00000a80| 6f 20 74 68 65 20 76 61 | 6c 75 65 20 69 66 20 61 |o the va|lue if a|
|00000a90| 76 61 69 6c 61 62 6c 65 | 2e 0d 20 2a 09 54 68 69 |vailable|.. *.Thi|
|00000aa0| 73 20 77 69 6c 6c 20 66 | 61 69 6c 20 69 66 20 74 |s will f|ail if t|
|00000ab0| 68 65 20 70 61 72 61 6d | 20 64 6f 65 73 20 6e 6f |he param| does no|
|00000ac0| 74 20 65 78 69 73 74 2e | 0d 20 2a 2f 0d 61 65 47 |t exist.|. */.aeG|
|00000ad0| 65 74 50 61 72 61 6d 28 | 4b 65 79 57 6f 72 64 2c |etParam(|KeyWord,|
|00000ae0| 20 56 61 6c 75 65 29 20 | 3a 2d 0d 09 61 65 47 65 | Value) |:-..aeGe|
|00000af0| 74 54 68 65 43 75 72 72 | 65 6e 74 45 76 65 6e 74 |tTheCurr|entEvent|
|00000b00| 28 41 70 70 6c 65 45 76 | 65 6e 74 2c 20 30 29 2c |(AppleEv|ent, 0),|
|00000b10| 0d 09 61 65 47 65 74 50 | 61 72 61 6d 44 65 73 63 |..aeGetP|aramDesc|
|00000b20| 28 41 70 70 6c 65 45 76 | 65 6e 74 2c 20 4b 65 79 |(AppleEv|ent, Key|
|00000b30| 57 6f 72 64 2c 20 60 2a | 2a 2a 2a 60 2c 20 44 65 |Word, `*|***`, De|
|00000b40| 73 63 2c 20 30 29 2c 0d | 09 63 6f 6e 76 65 72 74 |sc, 0),.|.convert|
|00000b50| 5f 61 65 64 65 73 63 31 | 28 44 65 73 63 2c 20 56 |_aedesc1|(Desc, V|
|00000b60| 61 6c 75 65 29 2e 0d 2f | 2a 0d 20 2a 20 61 65 47 |alue)../|*. * aeG|
|00000b70| 65 74 4c 6f 6e 67 41 74 | 74 72 69 62 75 74 65 28 |etLongAt|tribute(|
|00000b80| 41 70 70 6c 65 45 76 65 | 6e 74 2c 20 4b 65 79 57 |AppleEve|nt, KeyW|
|00000b90| 6f 72 64 2c 20 56 61 72 | 29 20 3a 2d 0d 20 2a 09 |ord, Var|) :-. *.|
|00000ba0| 52 65 74 72 69 65 76 65 | 20 74 68 65 20 64 65 73 |Retrieve| the des|
|00000bb0| 69 72 65 64 20 4b 65 79 | 77 6f 72 64 20 61 74 74 |ired Key|word att|
|00000bc0| 72 69 62 75 74 65 20 61 | 6e 64 20 72 65 74 75 72 |ribute a|nd retur|
|00000bd0| 6e 20 74 68 65 20 66 69 | 72 73 74 0d 20 2a 09 34 |n the fi|rst. *.4|
|00000be0| 20 62 79 74 65 73 20 61 | 73 20 61 6e 20 69 6e 74 | bytes a|s an int|
|00000bf0| 65 67 65 72 20 62 6f 75 | 6e 64 20 74 6f 20 56 61 |eger bou|nd to Va|
|00000c00| 72 2e 20 20 54 68 69 73 | 20 69 73 20 75 73 65 66 |r. This| is usef|
|00000c10| 75 6c 20 66 6f 72 0d 20 | 2a 09 72 65 74 72 69 65 |ul for. |*.retrie|
|00000c20| 76 69 6e 67 20 6c 6f 6e | 67 73 2c 20 6f 72 20 6b |ving lon|gs, or k|
|00000c30| 65 79 77 6f 72 64 73 2e | 0d 20 2a 2f 0d 61 65 47 |eywords.|. */.aeG|
|00000c40| 65 74 4c 6f 6e 67 41 74 | 74 72 69 62 75 74 65 28 |etLongAt|tribute(|
|00000c50| 41 70 70 6c 65 45 76 65 | 6e 74 2c 20 4b 65 79 57 |AppleEve|nt, KeyW|
|00000c60| 6f 72 64 2c 20 56 61 72 | 4c 6f 6e 67 29 20 3a 2d |ord, Var|Long) :-|
|00000c70| 0d 09 61 65 47 65 74 41 | 74 74 72 69 62 75 74 65 |..aeGetA|ttribute|
|00000c80| 44 65 73 63 28 41 70 70 | 6c 65 45 76 65 6e 74 2c |Desc(App|leEvent,|
|00000c90| 20 4b 65 79 57 6f 72 64 | 2c 20 60 2a 2a 2a 2a 60 | KeyWord|, `****`|
|00000ca0| 2c 0d 09 09 4d 69 73 73 | 69 6e 67 4b 65 79 57 6f |,...Miss|ingKeyWo|
|00000cb0| 72 64 44 65 73 63 2c 20 | 30 29 2c 0d 09 6d 65 6d |rdDesc, |0),..mem|
|00000cc0| 70 65 65 6b 5f 6c 6f 6e | 67 28 4d 69 73 73 69 6e |peek_lon|g(Missin|
|00000cd0| 67 4b 65 79 57 6f 72 64 | 44 65 73 63 5e 2e 64 61 |gKeyWord|Desc^.da|
|00000ce0| 74 61 48 61 6e 64 6c 65 | 2c 20 30 2c 20 56 61 72 |taHandle|, 0, Var|
|00000cf0| 4c 6f 6e 67 29 2e 0d 0d | 2f 2a 0d 20 2a 20 61 65 |Long)...|/*. * ae|
|00000d00| 43 6c 61 73 73 49 64 28 | 43 6c 61 73 73 2c 20 49 |ClassId(|Class, I|
|00000d10| 64 29 3a 0d 20 2a 09 52 | 65 74 72 69 65 76 65 20 |d):. *.R|etrieve |
|00000d20| 74 68 65 20 63 75 72 72 | 65 6e 74 20 61 70 70 6c |the curr|ent appl|
|00000d30| 65 20 65 76 65 6e 74 27 | 73 20 63 6c 61 73 73 20 |e event'|s class |
|00000d40| 61 6e 64 20 69 64 2e 0d | 20 2a 09 54 68 65 73 65 |and id..| *.These|
|00000d50| 20 61 72 65 20 72 65 74 | 75 72 6e 65 64 20 61 73 | are ret|urned as|
|00000d60| 20 6c 6f 6e 67 20 69 6e | 74 65 67 65 72 73 2e 20 | long in|tegers. |
|00000d70| 20 0d 20 2a 09 55 73 65 | 20 70 75 74 5f 6c 6f 6e | . *.Use| put_lon|
|00000d80| 67 20 74 6f 20 76 69 65 | 77 20 74 68 65 6d 20 77 |g to vie|w them w|
|00000d90| 68 65 6e 20 64 65 62 75 | 67 67 69 6e 67 2e 0d 20 |hen debu|gging.. |
|00000da0| 2a 2f 0d 61 65 43 6c 61 | 73 73 49 64 28 43 6c 61 |*/.aeCla|ssId(Cla|
|00000db0| 73 73 2c 20 49 64 29 20 | 3a 2d 0d 09 61 65 47 65 |ss, Id) |:-..aeGe|
|00000dc0| 74 54 68 65 43 75 72 72 | 65 6e 74 45 76 65 6e 74 |tTheCurr|entEvent|
|00000dd0| 28 41 70 70 6c 65 45 76 | 65 6e 74 2c 20 30 29 2c |(AppleEv|ent, 0),|
|00000de0| 0d 09 61 65 47 65 74 4c | 6f 6e 67 41 74 74 72 69 |..aeGetL|ongAttri|
|00000df0| 62 75 74 65 28 41 70 70 | 6c 65 45 76 65 6e 74 2c |bute(App|leEvent,|
|00000e00| 20 60 65 76 63 6c 60 2c | 20 43 6c 61 73 73 29 2c | `evcl`,| Class),|
|00000e10| 0d 09 61 65 47 65 74 4c | 6f 6e 67 41 74 74 72 69 |..aeGetL|ongAttri|
|00000e20| 62 75 74 65 28 41 70 70 | 6c 65 45 76 65 6e 74 2c |bute(App|leEvent,|
|00000e30| 20 60 65 76 69 64 60 2c | 20 49 64 29 2e 0d 0d 2f | `evid`,| Id).../|
|00000e40| 2a 0d 20 2a 20 61 65 41 | 6c 6c 50 61 72 61 6d 73 |*. * aeA|llParams|
|00000e50| 28 56 61 72 5f 4c 69 73 | 74 29 20 3a 2d 0d 20 2a |(Var_Lis|t) :-. *|
|00000e60| 09 56 61 72 5f 4c 69 73 | 74 20 77 69 6c 6c 20 62 |.Var_Lis|t will b|
|00000e70| 65 20 62 6f 75 6e 64 20 | 74 6f 20 61 20 6c 69 73 |e bound |to a lis|
|00000e80| 74 20 6f 66 20 61 6c 6c | 20 70 61 72 61 6d 65 74 |t of all| paramet|
|00000e90| 65 72 73 0d 20 2a 09 66 | 6f 72 20 74 68 65 20 63 |ers. *.f|or the c|
|00000ea0| 75 72 72 65 6e 74 20 61 | 70 70 6c 65 20 65 76 65 |urrent a|pple eve|
|00000eb0| 6e 74 2e 0d 20 2a 09 45 | 61 63 68 20 65 6c 65 6d |nt.. *.E|ach elem|
|00000ec0| 65 6e 74 20 69 6e 20 74 | 68 65 20 6c 69 73 74 20 |ent in t|he list |
|00000ed0| 74 61 6b 65 73 20 74 68 | 65 20 66 6f 72 6d 20 60 |takes th|e form `|
|00000ee0| 4b 65 79 57 6f 72 64 60 | 20 3d 20 76 61 6c 75 65 |KeyWord`| = value|
|00000ef0| 2e 0d 20 2a 09 4b 65 79 | 77 6f 72 64 20 77 69 6c |.. *.Key|word wil|
|00000f00| 6c 20 62 65 20 61 6e 20 | 69 6e 74 65 67 65 72 20 |l be an |integer |
|00000f10| 61 6e 64 20 63 61 6e 20 | 62 65 20 73 65 65 6e 20 |and can |be seen |
|00000f20| 77 69 74 68 20 70 75 74 | 5f 6c 6f 6e 67 2e 0d 20 |with put|_long.. |
|00000f30| 2a 09 56 61 6c 75 65 20 | 77 69 6c 6c 20 62 65 20 |*.Value |will be |
|00000f40| 61 20 70 72 6f 6c 6f 67 | 20 6f 62 6a 65 63 74 20 |a prolog| object |
|00000f50| 69 66 20 63 6f 6e 76 65 | 72 73 69 6f 6e 20 75 73 |if conve|rsion us|
|00000f60| 69 6e 67 0d 20 2a 09 63 | 6f 6e 76 65 72 74 5f 61 |ing. *.c|onvert_a|
|00000f70| 65 64 65 73 63 20 69 73 | 20 70 6f 73 73 69 62 6c |edesc is| possibl|
|00000f80| 65 2e 20 20 4f 74 68 65 | 72 77 69 73 65 20 69 74 |e. Othe|rwise it|
|00000f90| 20 77 69 6c 6c 20 62 65 | 20 61 6e 0d 20 2a 09 61 | will be| an. *.a|
|00000fa0| 65 64 65 73 63 20 6f 62 | 6a 65 63 74 2e 20 20 59 |edesc ob|ject. Y|
|00000fb0| 6f 75 20 64 6f 20 6e 6f | 74 20 6e 65 65 64 20 74 |ou do no|t need t|
|00000fc0| 6f 20 64 65 73 74 72 6f | 79 20 74 68 69 73 20 61 |o destro|y this a|
|00000fd0| 65 64 65 73 63 0d 20 2a | 09 6f 62 6a 65 63 74 2e |edesc. *|.object.|
|00000fe0| 20 20 50 72 6f 6c 6f 67 | 20 77 69 6c 6c 20 64 6f | Prolog| will do|
|00000ff0| 20 74 68 61 74 20 61 75 | 74 6f 6d 61 74 69 63 61 | that au|tomatica|
|00001000| 6c 6c 79 20 77 68 65 6e | 20 69 74 20 69 73 0d 20 |lly when| it is. |
|00001010| 2a 09 6e 6f 20 6c 6f 6e | 67 65 72 20 70 6f 69 6e |*.no lon|ger poin|
|00001020| 74 65 64 20 74 6f 2e 0d | 20 2a 2f 0d 61 65 41 6c |ted to..| */.aeAl|
|00001030| 6c 50 61 72 61 6d 73 28 | 4c 69 73 74 29 20 3a 2d |lParams(|List) :-|
|00001040| 0d 09 61 65 47 65 74 54 | 68 65 43 75 72 72 65 6e |..aeGetT|heCurren|
|00001050| 74 45 76 65 6e 74 28 41 | 70 70 6c 65 45 76 65 6e |tEvent(A|ppleEven|
|00001060| 74 2c 20 30 29 2c 0d 09 | 41 70 70 6c 65 45 76 65 |t, 0),..|AppleEve|
|00001070| 6e 74 5e 2e 64 65 73 63 | 72 69 70 74 6f 72 54 79 |nt^.desc|riptorTy|
|00001080| 70 65 20 69 73 20 60 72 | 65 63 6f 60 2c 0d 09 63 |pe is `r|eco`,..c|
|00001090| 6f 6e 76 65 72 74 5f 61 | 65 64 65 73 63 28 41 70 |onvert_a|edesc(Ap|
|000010a0| 70 6c 65 45 76 65 6e 74 | 2c 20 4c 69 73 74 29 2e |pleEvent|, List).|
|000010b0| 0d 0d 2f 2a 0d 20 2a 20 | 61 65 4d 69 73 73 69 6e |../*. * |aeMissin|
|000010c0| 67 50 61 72 61 6d 73 28 | 56 61 72 5f 4c 69 73 74 |gParams(|Var_List|
|000010d0| 29 20 3a 2d 0d 20 2a 09 | 56 61 72 5f 4c 69 73 74 |) :-. *.|Var_List|
|000010e0| 20 77 69 6c 6c 20 62 65 | 20 62 6f 75 6e 64 20 74 | will be| bound t|
|000010f0| 6f 20 61 20 6c 69 73 74 | 20 6f 66 20 61 20 70 61 |o a list| of a pa|
|00001100| 72 61 6d 65 74 65 72 73 | 0d 20 2a 09 74 68 61 74 |rameters|. *.that|
|00001110| 20 61 72 65 20 72 65 71 | 75 69 72 65 64 20 62 75 | are req|uired bu|
|00001120| 74 20 68 61 76 65 20 6e | 6f 74 20 62 65 65 6e 20 |t have n|ot been |
|00001130| 72 65 74 72 69 65 76 65 | 64 20 66 72 6f 6d 0d 20 |retrieve|d from. |
|00001140| 2a 09 74 68 65 20 63 75 | 72 72 65 6e 74 20 61 70 |*.the cu|rrent ap|
|00001150| 70 6c 65 20 65 76 65 6e | 74 2e 0d 20 2a 09 45 61 |ple even|t.. *.Ea|
|00001160| 63 68 20 65 6c 65 6d 65 | 6e 74 20 69 6e 20 74 68 |ch eleme|nt in th|
|00001170| 65 20 6c 69 73 74 20 74 | 61 6b 65 73 20 74 68 65 |e list t|akes the|
|00001180| 20 66 6f 72 6d 20 60 4b | 65 79 57 6f 72 64 60 20 | form `K|eyWord` |
|00001190| 3d 20 76 61 6c 75 65 2e | 0d 20 2a 09 4b 65 79 77 |= value.|. *.Keyw|
|000011a0| 6f 72 64 20 77 69 6c 6c | 20 62 65 20 61 6e 20 69 |ord will| be an i|
|000011b0| 6e 74 65 67 65 72 20 61 | 6e 64 20 63 61 6e 20 62 |nteger a|nd can b|
|000011c0| 65 20 73 65 65 6e 20 77 | 69 74 68 20 70 75 74 5f |e seen w|ith put_|
|000011d0| 6c 6f 6e 67 2e 0d 20 2a | 09 56 61 6c 75 65 20 77 |long.. *|.Value w|
|000011e0| 69 6c 6c 20 62 65 20 61 | 20 70 72 6f 6c 6f 67 20 |ill be a| prolog |
|000011f0| 6f 62 6a 65 63 74 20 69 | 66 20 63 6f 6e 76 65 72 |object i|f conver|
|00001200| 73 69 6f 6e 20 75 73 69 | 6e 67 0d 20 2a 09 63 6f |sion usi|ng. *.co|
|00001210| 6e 76 65 72 74 5f 61 65 | 64 65 73 63 20 69 73 20 |nvert_ae|desc is |
|00001220| 70 6f 73 73 69 62 6c 65 | 2e 20 20 4f 74 68 65 72 |possible|. Other|
|00001230| 77 69 73 65 20 69 74 20 | 77 69 6c 6c 20 62 65 20 |wise it |will be |
|00001240| 61 6e 0d 20 2a 09 61 65 | 64 65 73 63 20 6f 62 6a |an. *.ae|desc obj|
|00001250| 65 63 74 2e 20 20 59 6f | 75 20 64 6f 20 6e 6f 74 |ect. Yo|u do not|
|00001260| 20 6e 65 65 64 20 74 6f | 20 64 65 73 74 72 6f 79 | need to| destroy|
|00001270| 20 74 68 69 73 20 61 65 | 64 65 73 63 0d 20 2a 09 | this ae|desc. *.|
|00001280| 6f 62 6a 65 63 74 2e 20 | 20 50 72 6f 6c 6f 67 20 |object. | Prolog |
|00001290| 77 69 6c 6c 20 64 6f 20 | 74 68 61 74 20 61 75 74 |will do |that aut|
|000012a0| 6f 6d 61 74 69 63 61 6c | 6c 79 20 77 68 65 6e 20 |omatical|ly when |
|000012b0| 69 74 20 69 73 0d 20 2a | 09 6e 6f 20 6c 6f 6e 67 |it is. *|.no long|
|000012c0| 65 72 20 70 6f 69 6e 74 | 65 64 20 74 6f 2e 0d 20 |er point|ed to.. |
|000012d0| 2a 20 57 61 72 6e 69 6e | 67 3a 20 4f 6e 63 65 20 |* Warnin|g: Once |
|000012e0| 63 61 6c 6c 65 64 2c 20 | 74 68 65 20 70 61 72 61 |called, |the para|
|000012f0| 6d 65 74 65 72 73 20 61 | 6e 64 20 74 68 65 69 72 |meters a|nd their|
|00001300| 20 64 61 74 61 20 72 65 | 74 72 69 65 76 65 64 0d | data re|trieved.|
|00001310| 20 2a 09 77 69 6c 6c 20 | 6e 6f 20 6c 6f 6e 67 65 | *.will |no longe|
|00001320| 72 20 62 65 20 63 6f 6e | 73 69 64 65 72 65 64 20 |r be con|sidered |
|00001330| 61 20 6d 69 73 73 69 6e | 67 20 70 61 72 61 6d 65 |a missin|g parame|
|00001340| 74 65 72 2e 0d 20 2a 20 | 54 68 75 73 20 79 6f 75 |ter.. * |Thus you|
|00001350| 20 63 61 6e 20 6f 6e 6c | 79 20 63 61 6c 6c 20 74 | can onl|y call t|
|00001360| 68 69 73 20 6f 6e 63 65 | 20 70 65 72 20 41 70 70 |his once| per App|
|00001370| 6c 65 20 45 76 65 6e 74 | 2e 0d 20 2a 2f 0d 61 65 |le Event|.. */.ae|
|00001380| 4d 69 73 73 69 6e 67 50 | 61 72 61 6d 73 28 5b 4d |MissingP|arams([M|
|00001390| 69 73 73 69 6e 67 50 61 | 72 61 6d 20 7c 20 52 65 |issingPa|ram | Re|
|000013a0| 73 74 5d 29 20 3a 2d 0d | 09 61 65 4d 69 73 73 69 |st]) :-.|.aeMissi|
|000013b0| 6e 67 50 61 72 61 6d 28 | 4d 69 73 73 69 6e 67 50 |ngParam(|MissingP|
|000013c0| 61 72 61 6d 29 2c 20 21 | 2c 0d 09 61 65 4d 69 73 |aram), !|,..aeMis|
|000013d0| 73 69 6e 67 50 61 72 61 | 6d 73 28 52 65 73 74 29 |singPara|ms(Rest)|
|000013e0| 2e 0d 61 65 4d 69 73 73 | 69 6e 67 50 61 72 61 6d |..aeMiss|ingParam|
|000013f0| 73 28 5b 5d 29 2e 0d 0d | 2f 2a 0d 20 2a 20 4d 69 |s([])...|/*. * Mi|
|00001400| 73 73 69 6e 67 5f 70 61 | 72 61 6d 28 60 4b 65 79 |ssing_pa|ram(`Key|
|00001410| 57 6f 72 64 60 20 3d 20 | 56 61 6c 75 65 29 3a 20 |Word` = |Value): |
|00001420| 52 65 74 75 72 6e 73 20 | 74 68 65 20 6e 65 78 74 |Returns |the next|
|00001430| 20 72 65 71 75 69 72 65 | 64 0d 20 2a 09 70 61 72 | require|d. *.par|
|00001440| 61 6d 65 74 65 72 73 20 | 74 68 61 74 20 68 61 73 |ameters |that has|
|00001450| 20 6e 6f 74 20 79 65 74 | 20 62 65 65 6e 20 72 65 | not yet| been re|
|00001460| 74 72 69 65 76 65 64 20 | 66 72 6f 6d 20 74 68 65 |trieved |from the|
|00001470| 0d 20 2a 09 63 75 72 72 | 65 6e 74 20 61 70 70 6c |. *.curr|ent appl|
|00001480| 65 20 65 76 65 6e 74 2e | 20 20 54 68 69 73 20 77 |e event.| This w|
|00001490| 69 6c 6c 20 66 61 69 6c | 20 69 66 20 74 68 65 72 |ill fail| if ther|
|000014a0| 65 20 69 73 20 6e 6f 0d | 20 2a 09 72 65 71 75 69 |e is no.| *.requi|
|000014b0| 72 65 64 20 61 70 70 6c | 65 20 65 76 65 6e 74 20 |red appl|e event |
|000014c0| 70 61 72 61 6d 65 74 65 | 72 20 74 68 61 74 20 68 |paramete|r that h|
|000014d0| 61 73 20 6e 6f 74 20 62 | 65 65 6e 20 72 65 74 72 |as not b|een retr|
|000014e0| 69 65 76 65 64 20 79 65 | 74 2e 0d 20 2a 20 57 61 |ieved ye|t.. * Wa|
|000014f0| 72 6e 69 6e 67 3a 20 4f | 6e 63 65 20 63 61 6c 6c |rning: O|nce call|
|00001500| 65 64 2c 20 74 68 65 20 | 70 61 72 61 6d 65 74 65 |ed, the |paramete|
|00001510| 72 20 61 6e 64 20 69 74 | 73 20 64 61 74 61 20 72 |r and it|s data r|
|00001520| 65 74 72 69 65 76 65 64 | 0d 20 2a 09 77 69 6c 6c |etrieved|. *.will|
|00001530| 20 6e 6f 20 6c 6f 6e 67 | 65 72 20 62 65 20 63 6f | no long|er be co|
|00001540| 6e 73 69 64 65 72 65 64 | 20 61 20 6d 69 73 73 69 |nsidered| a missi|
|00001550| 6e 67 20 70 61 72 6d 61 | 74 65 72 2e 0d 20 2a 20 |ng parma|ter.. * |
|00001560| 43 61 6c 6c 69 6e 67 20 | 74 68 69 73 20 72 65 70 |Calling |this rep|
|00001570| 65 61 74 65 64 6c 79 20 | 77 69 6c 6c 20 67 65 74 |eatedly |will get|
|00001580| 20 64 69 66 66 65 72 65 | 6e 74 20 61 6e 73 77 65 | differe|nt answe|
|00001590| 72 73 20 75 6e 74 69 6c | 0d 20 2a 20 61 6c 6c 20 |rs until|. * all |
|000015a0| 72 65 71 75 69 72 65 64 | 20 70 61 72 61 6d 65 74 |required| paramet|
|000015b0| 65 72 73 20 74 68 61 74 | 20 68 61 76 65 20 6e 6f |ers that| have no|
|000015c0| 74 20 62 65 65 6e 20 72 | 65 74 72 69 65 76 65 64 |t been r|etrieved|
|000015d0| 20 68 61 76 65 20 62 65 | 65 6e 0d 20 2a 20 72 65 | have be|en. * re|
|000015e0| 74 75 72 6e 65 64 2e 20 | 20 41 66 74 65 72 20 74 |turned. | After t|
|000015f0| 68 61 74 2c 20 74 68 69 | 73 20 66 75 6e 63 74 69 |hat, thi|s functi|
|00001600| 6f 6e 20 77 69 6c 6c 20 | 61 6c 77 61 79 73 20 66 |on will |always f|
|00001610| 61 69 6c 20 66 6f 72 20 | 74 68 61 74 0d 20 2a 20 |ail for |that. * |
|00001620| 41 70 70 6c 65 20 45 76 | 65 6e 74 2e 0d 20 2a 2f |Apple Ev|ent.. */|
|00001630| 0d 61 65 4d 69 73 73 69 | 6e 67 50 61 72 61 6d 28 |.aeMissi|ngParam(|
|00001640| 4b 65 79 57 6f 72 64 20 | 3d 20 56 61 6c 75 65 29 |KeyWord |= Value)|
|00001650| 20 3a 2d 0d 09 61 65 47 | 65 74 54 68 65 43 75 72 | :-..aeG|etTheCur|
|00001660| 72 65 6e 74 45 76 65 6e | 74 28 41 70 70 6c 65 45 |rentEven|t(AppleE|
|00001670| 76 65 6e 74 2c 20 30 29 | 2c 0d 09 61 65 47 65 74 |vent, 0)|,..aeGet|
|00001680| 4c 6f 6e 67 41 74 74 72 | 69 62 75 74 65 28 41 70 |LongAttr|ibute(Ap|
|00001690| 70 6c 65 45 76 65 6e 74 | 2c 20 60 6d 69 73 73 60 |pleEvent|, `miss`|
|000016a0| 2c 20 4b 65 79 57 6f 72 | 64 29 2c 0d 09 61 65 47 |, KeyWor|d),..aeG|
|000016b0| 65 74 50 61 72 61 6d 44 | 65 73 63 28 41 70 70 6c |etParamD|esc(Appl|
|000016c0| 65 45 76 65 6e 74 2c 20 | 4b 65 79 57 6f 72 64 2c |eEvent, |KeyWord,|
|000016d0| 20 60 2a 2a 2a 2a 60 2c | 0d 09 09 50 61 72 61 6d | `****`,|...Param|
|000016e0| 44 65 73 63 2c 20 30 29 | 2c 0d 09 63 6f 6e 76 65 |Desc, 0)|,..conve|
|000016f0| 72 74 5f 61 65 64 65 73 | 63 31 28 50 61 72 61 6d |rt_aedes|c1(Param|
|00001700| 44 65 73 63 2c 20 56 61 | 6c 75 65 29 2e 0d 09 0d |Desc, Va|lue)....|
|00001710| 2f 2a 0d 20 2a 20 74 68 | 69 73 5f 70 72 6f 63 65 |/*. * th|is_proce|
|00001720| 73 73 28 50 72 6f 63 65 | 73 73 49 6e 66 6f 52 65 |ss(Proce|ssInfoRe|
|00001730| 63 29 0d 20 2a 09 52 65 | 74 75 72 6e 20 74 68 65 |c). *.Re|turn the|
|00001740| 20 70 72 6f 63 65 73 73 | 49 6e 66 6f 52 65 63 20 | process|InfoRec |
|00001750| 61 73 73 6f 63 69 61 74 | 65 64 20 77 69 74 68 20 |associat|ed with |
|00001760| 74 68 69 73 20 72 75 6e | 6e 69 6e 67 0d 20 2a 09 |this run|ning. *.|
|00001770| 70 72 6f 6c 6f 67 20 61 | 70 70 6c 69 63 61 74 69 |prolog a|pplicati|
|00001780| 6f 6e 2e 0d 20 2a 20 54 | 68 69 73 20 69 73 20 75 |on.. * T|his is u|
|00001790| 73 65 66 75 6c 20 74 6f | 20 73 65 6e 64 20 61 70 |seful to| send ap|
|000017a0| 70 6c 65 20 65 76 65 6e | 74 73 20 74 6f 20 74 68 |ple even|ts to th|
|000017b0| 69 73 20 73 61 6d 65 20 | 50 72 6f 6c 6f 67 20 70 |is same |Prolog p|
|000017c0| 72 6f 63 65 73 73 2c 0d | 20 2a 09 75 73 69 6e 67 |rocess,.| *.using|
|000017d0| 20 73 65 6e 64 5f 61 70 | 70 6c 65 5f 65 76 65 6e | send_ap|ple_even|
|000017e0| 74 2e 0d 20 2a 2f 0d 74 | 68 69 73 5f 70 72 6f 63 |t.. */.t|his_proc|
|000017f0| 65 73 73 28 50 72 6f 63 | 65 73 73 49 6e 66 6f 52 |ess(Proc|essInfoR|
|00001800| 65 63 29 20 3a 2d 0d 09 | 67 65 74 43 75 72 72 65 |ec) :-..|getCurre|
|00001810| 6e 74 50 72 6f 63 65 73 | 73 28 50 72 6f 63 65 73 |ntProces|s(Proces|
|00001820| 73 53 65 72 69 61 6c 4e | 75 6d 62 65 72 2c 20 30 |sSerialN|umber, 0|
|00001830| 29 2c 0d 09 70 72 6f 63 | 65 73 73 28 50 72 6f 63 |),..proc|ess(Proc|
|00001840| 65 73 73 49 6e 66 6f 52 | 65 63 2c 20 5f 50 72 6f |essInfoR|ec, _Pro|
|00001850| 63 65 73 73 4e 61 6d 65 | 29 2c 0d 09 2f 2a 0d 09 |cessName|),../*..|
|00001860| 20 2a 20 49 66 20 77 65 | 20 63 6f 6d 70 61 72 65 | * If we| compare|
|00001870| 20 74 68 65 20 72 65 63 | 6f 72 64 2c 20 74 68 65 | the rec|ord, the|
|00001880| 20 61 64 64 72 65 73 73 | 20 6f 66 20 74 68 65 20 | address| of the |
|00001890| 72 65 63 6f 72 64 73 0d | 09 20 2a 09 77 69 6c 6c |records.|. *.will|
|000018a0| 20 62 65 20 63 6f 6d 70 | 61 72 65 64 2c 20 6e 6f | be comp|ared, no|
|000018b0| 74 20 74 68 65 20 64 61 | 74 61 20 69 6e 20 74 68 |t the da|ta in th|
|000018c0| 65 20 72 65 63 6f 72 64 | 73 2e 0d 09 20 2a 20 57 |e record|s... * W|
|000018d0| 65 20 6e 65 65 64 20 74 | 6f 20 63 6f 6d 70 61 72 |e need t|o compar|
|000018e0| 65 20 74 68 65 20 64 61 | 74 61 20 6f 6e 6c 79 2e |e the da|ta only.|
|000018f0| 0d 09 20 2a 2f 0d 09 50 | 72 6f 63 65 73 73 49 6e |.. */..P|rocessIn|
|00001900| 66 6f 52 65 63 5e 2e 70 | 72 6f 63 65 73 73 4e 75 |foRec^.p|rocessNu|
|00001910| 6d 62 65 72 5e 2e 68 69 | 67 68 4c 6f 6e 67 4f 66 |mber^.hi|ghLongOf|
|00001920| 50 53 4e 20 3d 3a 3d 20 | 0d 09 09 50 72 6f 63 65 |PSN =:= |...Proce|
|00001930| 73 73 53 65 72 69 61 6c | 4e 75 6d 62 65 72 5e 2e |ssSerial|Number^.|
|00001940| 68 69 67 68 4c 6f 6e 67 | 4f 66 50 53 4e 2c 0d 09 |highLong|OfPSN,..|
|00001950| 50 72 6f 63 65 73 73 49 | 6e 66 6f 52 65 63 5e 2e |ProcessI|nfoRec^.|
|00001960| 70 72 6f 63 65 73 73 4e | 75 6d 62 65 72 5e 2e 6c |processN|umber^.l|
|00001970| 6f 77 4c 6f 6e 67 4f 66 | 50 53 4e 20 3d 3a 3d 20 |owLongOf|PSN =:= |
|00001980| 0d 09 09 50 72 6f 63 65 | 73 73 53 65 72 69 61 6c |...Proce|ssSerial|
|00001990| 4e 75 6d 62 65 72 5e 2e | 6c 6f 77 4c 6f 6e 67 4f |Number^.|lowLongO|
|000019a0| 66 50 53 4e 2c 0d 09 21 | 2e 0d 0d 2f 2a 0d 20 2a |fPSN,..!|.../*. *|
|000019b0| 20 62 72 65 61 6b 5f 67 | 65 6e 65 72 69 63 5f 61 | break_g|eneric_a|
|000019c0| 70 70 6c 65 5f 65 76 65 | 6e 74 73 20 3a 0d 20 2a |pple_eve|nts :. *|
|000019d0| 09 72 75 6e 20 74 68 69 | 73 20 66 75 6e 63 74 69 |.run thi|s functi|
|000019e0| 6f 6e 20 74 6f 20 69 6e | 73 74 61 6c 6c 20 61 20 |on to in|stall a |
|000019f0| 67 65 6e 65 72 69 63 20 | 61 70 70 6c 65 20 65 76 |generic |apple ev|
|00001a00| 65 6e 74 20 68 6f 6f 6b | 0d 20 2a 09 74 68 61 74 |ent hook|. *.that|
|00001a10| 20 77 69 6c 6c 20 72 65 | 70 6f 72 74 20 61 6e 79 | will re|port any|
|00001a20| 20 61 70 70 6c 65 20 65 | 76 65 6e 74 73 20 74 68 | apple e|vents th|
|00001a30| 61 74 20 61 72 65 20 73 | 65 6e 74 20 74 6f 20 50 |at are s|ent to P|
|00001a40| 72 6f 6c 6f 67 0d 20 2a | 09 74 68 61 74 20 61 72 |rolog. *|.that ar|
|00001a50| 65 20 6e 6f 74 20 68 61 | 6e 64 6c 65 64 20 62 79 |e not ha|ndled by|
|00001a60| 20 6d 6f 72 65 20 73 70 | 65 63 69 66 69 63 20 61 | more sp|ecific a|
|00001a70| 70 70 6c 65 20 65 76 65 | 6e 74 20 68 6f 6f 6b 73 |pple eve|nt hooks|
|00001a80| 2e 0d 20 2a 09 54 68 69 | 73 20 77 69 6c 6c 20 65 |.. *.Thi|s will e|
|00001a90| 6e 74 65 72 20 61 20 6e | 65 73 74 65 64 20 70 72 |nter a n|ested pr|
|00001aa0| 6f 6c 6f 67 20 69 6e 74 | 65 72 70 72 65 74 65 72 |olog int|erpreter|
|00001ab0| 20 74 68 61 74 20 63 61 | 6e 20 62 65 0d 20 2a 09 | that ca|n be. *.|
|00001ac0| 75 73 65 64 20 74 6f 20 | 74 68 65 6e 20 68 61 6e |used to |then han|
|00001ad0| 64 6c 65 20 61 6e 64 20 | 61 6e 61 6c 79 7a 65 20 |dle and |analyze |
|00001ae0| 74 68 65 20 65 76 65 6e | 74 20 6d 61 6e 75 61 6c |the even|t manual|
|00001af0| 6c 79 2e 0d 20 2a 2f 0d | 62 72 65 61 6b 5f 67 65 |ly.. */.|break_ge|
|00001b00| 6e 65 72 69 63 5f 61 70 | 70 6c 65 5f 65 76 65 6e |neric_ap|ple_even|
|00001b10| 74 73 20 3a 2d 0d 09 64 | 65 66 69 6e 65 5f 61 70 |ts :-..d|efine_ap|
|00001b20| 70 6c 65 5f 65 76 65 6e | 74 28 60 2a 2a 2a 2a 60 |ple_even|t(`****`|
|00001b30| 2c 60 2a 2a 2a 2a 60 2c | 0d 09 09 28 61 65 43 6c |,`****`,|...(aeCl|
|00001b40| 61 73 73 49 64 28 43 6c | 61 73 73 2c 20 49 64 29 |assId(Cl|ass, Id)|
|00001b50| 2c 0d 09 20 09 20 61 65 | 47 65 74 41 74 74 72 69 |,.. . ae|GetAttri|
|00001b60| 62 75 74 65 28 60 72 74 | 69 64 60 2c 20 52 74 49 |bute(`rt|id`, RtI|
|00001b70| 64 29 2c 0d 09 20 09 20 | 66 6f 72 6d 61 74 28 27 |d),.. . |format('|
|00001b80| 0d a5 a5 a5 a5 a5 a5 a5 | a5 a5 a5 a5 a5 a5 a5 a5 |........|........|
|00001b90| a5 a5 a5 a5 a5 a5 a5 a5 | a5 a5 a5 a5 a5 a5 a5 a5 |........|........|
|00001ba0| a5 a5 a5 a5 a5 a5 a5 a5 | a5 a5 a5 a5 a5 a5 a5 a5 |........|........|
|00001bb0| a5 a5 a5 a5 a5 a5 0d 52 | 65 63 65 69 76 65 64 20 |.......R|eceived |
|00001bc0| 61 6e 20 75 6e 68 61 6e | 64 6c 65 64 20 41 70 70 |an unhan|dled App|
|00001bd0| 6c 65 20 45 76 65 6e 74 | 2e 0d 41 70 70 6c 65 20 |le Event|..Apple |
|00001be0| 45 76 65 6e 74 20 23 25 | 64 2c 20 43 6c 61 73 73 |Event #%|d, Class|
|00001bf0| 3a 20 60 25 34 63 60 2c | 20 49 64 3a 20 60 25 34 |: `%4c`,| Id: `%4|
|00001c00| 63 60 5c 6e 0d 59 6f 75 | 20 6d 61 79 20 72 65 74 |c`\n.You| may ret|
|00001c10| 72 69 65 76 65 20 74 68 | 69 73 20 61 70 70 6c 65 |rieve th|is apple|
|00001c20| 20 65 76 65 6e 74 20 6f | 62 6a 65 63 74 20 64 75 | event o|bject du|
|00001c30| 72 69 6e 67 20 74 68 69 | 73 20 0d 6e 65 73 74 65 |ring thi|s .neste|
|00001c40| 64 20 70 72 6f 6c 6f 67 | 20 73 65 73 73 69 6f 6e |d prolog| session|
|00001c50| 20 75 73 69 6e 67 20 0d | 3f 2d 20 61 65 47 65 74 | using .|?- aeGet|
|00001c60| 54 68 65 43 75 72 72 65 | 6e 74 45 76 65 6e 74 28 |TheCurre|ntEvent(|
|00001c70| 41 70 70 6c 65 45 76 65 | 6e 74 2c 20 30 29 2e 0d |AppleEve|nt, 0)..|
|00001c80| 54 6f 20 65 6e 64 20 74 | 68 65 20 6e 65 73 74 65 |To end t|he neste|
|00001c90| 64 20 70 72 6f 6c 6f 67 | 20 73 65 73 73 69 6f 6e |d prolog| session|
|00001ca0| 2c 20 74 79 70 65 20 63 | 6f 6d 6d 61 6e 64 2d 65 |, type c|ommand-e|
|00001cb0| 6e 74 65 72 20 28 65 6e | 64 20 6f 66 20 66 69 6c |nter (en|d of fil|
|00001cc0| 65 29 2e 0d 41 66 74 65 | 72 20 65 6e 64 69 6e 67 |e)..Afte|r ending|
|00001cd0| 20 74 68 69 73 20 6e 65 | 73 74 65 64 20 70 72 6f | this ne|sted pro|
|00001ce0| 6c 6f 67 20 73 65 73 73 | 69 6f 6e 2c 20 0d 74 68 |log sess|ion, .th|
|00001cf0| 69 73 20 65 76 65 6e 74 | 20 77 69 6c 6c 20 68 61 |is event| will ha|
|00001d00| 76 65 20 66 69 6e 69 73 | 68 65 64 2c 0d 61 6e 64 |ve finis|hed,.and|
|00001d10| 20 73 68 6f 75 6c 64 20 | 6e 6f 74 20 62 65 20 72 | should |not be r|
|00001d20| 65 66 65 72 72 65 64 20 | 74 6f 20 61 6e 79 6d 6f |eferred |to anymo|
|00001d30| 72 65 2e 0d a5 a5 a5 a5 | a5 a5 a5 a5 a5 a5 a5 a5 |re......|........|
|00001d40| a5 a5 a5 a5 a5 a5 a5 a5 | a5 a5 a5 a5 a5 a5 a5 a5 |........|........|
|00001d50| a5 a5 a5 a5 a5 a5 a5 a5 | a5 a5 a5 a5 a5 a5 a5 a5 |........|........|
|00001d60| a5 a5 a5 a5 a5 a5 a5 a5 | a5 0d 27 2c 5b 52 74 49 |........|..',[RtI|
|00001d70| 64 2c 20 43 6c 61 73 73 | 2c 20 49 64 5d 29 2c 0d |d, Class|, Id]),.|
|00001d80| 09 20 09 20 70 72 6f 6c | 6f 67 2c 0d 09 20 09 20 |. . prol|og,.. . |
|00001d90| 66 6f 72 6d 61 74 28 27 | 0d a5 a5 a5 a5 a5 a5 a5 |format('|........|
|00001da0| a5 a5 a5 a5 a5 a5 a5 a5 | a5 a5 a5 a5 a5 a5 a5 a5 |........|........|
|00001db0| a5 a5 a5 a5 a5 a5 a5 a5 | a5 a5 a5 a5 a5 a5 a5 a5 |........|........|
|00001dc0| a5 a5 a5 a5 a5 a5 a5 a5 | a5 a5 a5 a5 a5 a5 0d 45 |........|.......E|
|00001dd0| 6e 64 20 6f 66 20 41 70 | 70 6c 65 20 45 76 65 6e |nd of Ap|ple Even|
|00001de0| 74 20 23 25 64 2c 20 43 | 6c 61 73 73 3a 20 60 25 |t #%d, C|lass: `%|
|00001df0| 34 63 60 2c 20 49 64 3a | 20 60 25 34 63 60 0d a5 |4c`, Id:| `%4c`..|
|00001e00| a5 a5 a5 a5 a5 a5 a5 a5 | a5 a5 a5 a5 a5 a5 a5 a5 |........|........|
|00001e10| a5 a5 a5 a5 a5 a5 a5 a5 | a5 a5 a5 a5 a5 a5 a5 a5 |........|........|
|00001e20| a5 a5 a5 a5 a5 a5 a5 a5 | a5 a5 a5 a5 a5 a5 a5 a5 |........|........|
|00001e30| a5 a5 a5 a5 0d 27 2c 0d | 09 20 09 20 20 5b 52 74 |.....',.|. . [Rt|
|00001e40| 49 64 2c 20 43 6c 61 73 | 73 2c 20 49 64 5d 29 29 |Id, Clas|s, Id]))|
|00001e50| 29 2e 0d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |).......|........|
|00001e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e80| 00 00 01 00 00 00 01 22 | 00 00 00 22 00 00 00 5a |......."|..."...Z|
|00001e90| 02 fc 70 01 60 00 02 f6 | 70 ff 60 00 02 f0 70 02 |..p.`...|p.`...p.|
|00001ea0| 2d 40 ff e4 32 2e 00 08 | 48 c1 2d 41 ff dc 60 5e |-@..2...|H.-A..`^|
|00001eb0| 0f 61 70 70 6c 65 20 65 | 76 65 6e 74 73 31 2e 70 |.apple e|vents1.p|
|00001ec0| 02 00 00 00 54 45 58 54 | 41 49 46 43 01 00 00 14 |....TEXT|AIFC....|
|00001ed0| 00 00 54 45 58 54 41 49 | 46 43 01 00 00 14 00 00 |..TEXTAI|FC......|
|00001ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ef0| 00 00 a5 ba 14 38 00 00 | 1d d3 00 00 01 7c 6e 08 |.....8..|.....|n.|
|00001f00| 70 09 b0 ae ff e4 6c 06 | 70 09 2d 40 ff e4 70 03 |p.....l.|p.-@..p.|
|00001f10| c0 ae 00 10 67 00 00 b8 | 20 2e 00 10 08 00 00 00 |....g...| .......|
|00001f20| 67 06 70 01 60 00 02 66 | 30 2e 00 10 48 c0 2d 40 |g.p.`..f|0...H.-@|
|00001f30| ff e0 20 2e ff e4 55 80 | 6b 00 00 8e 0c 80 00 00 |.. ...U.|k.......|
|00001f40| 00 01 6e 00 00 84 d0 80 | 30 3b 08 06 4e fb 00 00 |..n.....|0;..N...|
|00001f50| 00 06 00 2c 20 2e ff dc | b0 ae ff e0 66 06 70 00 |..., ...|....f.p.|
|00001f60| 60 00 02 2a 20 2e ff dc | b0 ae ff e0 6c 06 70 ff |`..* ...|....l.p.|
|00001f70| 60 00 02 1a 70 01 60 00 | 02 14 48 6e ff e0 48 6e |`...p.`.|..Hn..Hn|
|00001f80| 00 00 00 0a 00 09 06 4d | 6f 6e 61 63 6f 1a 00 00 |.......M|onaco...|
|00001f90| 00 08 00 4f 00 1a 01 49 | 01 f8 00 00 00 04 00 30 |...O...I|.......0|
|00001fa0| 00 08 00 00 01 00 00 00 | 01 22 00 00 00 22 00 00 |........|."..."..|
|00001fb0| 00 5a 00 21 54 ac 05 e2 | 00 00 00 1c 00 5a 00 02 |.Z.!T...|.....Z..|
|00001fc0| 45 46 4e 54 00 00 00 1a | 45 57 4e 44 00 00 00 26 |EFNT....|EWND...&|
|00001fd0| 45 54 41 42 00 00 00 32 | 03 eb ff ff 00 00 00 00 |ETAB...2|........|
|00001fe0| 00 21 67 84 01 00 ff ff | 00 00 00 0e 00 21 67 80 |.!g.....|.....!g.|
|00001ff0| 03 ec ff ff 00 00 00 1a | 00 21 69 88 00 00 00 00 |........|.!i.....|
+--------+-------------------------+-------------------------+--------+--------+